package com.emcom.gotour.mvc.view;

import java.io.Serializable;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.springframework.context.MessageSource;

import com.emcom.gotour.mvc.message.NavigationMessage;

public class NavigationView implements Comparable<Object>, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 916382259605092333L;
	private String navigationManage;
	private String navigationCategory;
	private String navigationTour;
	private String navigationTourDetail;
	private String navigationInsertTour;
	private String navigationUpdateTour;
	private String navigationTourScheduler;
	private String navigationUpdateTourScheduler;
	private String chinese;
	private String english;
	private String position;
	public NavigationView() {
	}
	public NavigationView(HttpServletRequest request, MessageSource messageSource) {
		this.navigationManage = NavigationMessage.Manage.value(request, messageSource);
		this.navigationCategory = NavigationMessage.Category.value(request, messageSource);
		this.navigationTour = NavigationMessage.Tour.value(request, messageSource);
		this.navigationTourDetail = NavigationMessage.TourDetail.value(request, messageSource);
		this.navigationInsertTour = NavigationMessage.InsertTour.value(request, messageSource);
		this.navigationUpdateTour = NavigationMessage.UpdateTour.value(request, messageSource);
		this.navigationTourScheduler = NavigationMessage.TourScheduler.value(request, messageSource);
		this.navigationUpdateTourScheduler = NavigationMessage.UpdateTourScheduler.value(request, messageSource);
		this.position = NavigationMessage.Position.value(request, messageSource);
		this.chinese = NavigationMessage.Chinses.value(request, messageSource);
		this.english = NavigationMessage.English.value(request, messageSource);
	}
	public String getNavigationManage() {
		return navigationManage;
	}
	public void setNavigationManage(String navigationManage) {
		this.navigationManage = navigationManage;
	}
	public String getNavigationCategory() {
		return navigationCategory;
	}
	public void setNavigationCategory(String navigationCategory) {
		this.navigationCategory = navigationCategory;
	}
	public String getNavigationTour() {
		return navigationTour;
	}
	public void setNavigationTour(String navigationTour) {
		this.navigationTour = navigationTour;
	}
	public String getNavigationTourDetail() {
		return navigationTourDetail;
	}
	public void setNavigationTourDetail(String navigationTourDetail) {
		this.navigationTourDetail = navigationTourDetail;
	}
	public String getNavigationInsertTour() {
		return navigationInsertTour;
	}
	public void setNavigationInsertTour(String navigationInsertTour) {
		this.navigationInsertTour = navigationInsertTour;
	}
	public String getNavigationUpdateTour() {
		return navigationUpdateTour;
	}
	public void setNavigationUpdateTour(String navigationUpdateTour) {
		this.navigationUpdateTour = navigationUpdateTour;
	}
	public String getNavigationTourScheduler() {
		return navigationTourScheduler;
	}
	public void setNavigationTourScheduler(String navigationTourScheduler) {
		this.navigationTourScheduler = navigationTourScheduler;
	}
	public String getNavigationUpdateTourScheduler() {
		return navigationUpdateTourScheduler;
	}
	public void setNavigationUpdateTourScheduler(
			String navigationUpdateTourScheduler) {
		this.navigationUpdateTourScheduler = navigationUpdateTourScheduler;
	}
	public String getChinese() {
		return chinese;
	}
	public void setChinese(String chinese) {
		this.chinese = chinese;
	}
	public String getEnglish() {
		return english;
	}
	public void setEnglish(String english) {
		this.english = english;
	}
	public String getPosition() {
		return position;
	}
	public void setPosition(String position) {
		this.position = position;
	}
	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		NavigationView myClass = (NavigationView) object;
		return new CompareToBuilder()
				.append(this.position, myClass.position)
				.append(this.navigationUpdateTour, myClass.navigationUpdateTour)
				.append(this.navigationInsertTour, myClass.navigationInsertTour)
				.append(this.navigationCategory, myClass.navigationCategory)
				.append(this.navigationTourScheduler,
						myClass.navigationTourScheduler)
				.append(this.navigationManage, myClass.navigationManage)
				.append(this.navigationTourDetail, myClass.navigationTourDetail)
				.append(this.english, myClass.english).append(this.chinese,
						myClass.chinese).append(this.navigationTour,
						myClass.navigationTour).append(
						this.navigationUpdateTourScheduler,
						myClass.navigationUpdateTourScheduler).toComparison();
	}
	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof NavigationView)) {
			return false;
		}
		NavigationView rhs = (NavigationView) object;
		return new EqualsBuilder().appendSuper(super.equals(object)).append(
				this.position, rhs.position).append(this.navigationUpdateTour,
				rhs.navigationUpdateTour).append(this.navigationInsertTour,
				rhs.navigationInsertTour).append(this.navigationCategory,
				rhs.navigationCategory).append(this.navigationTourScheduler,
				rhs.navigationTourScheduler).append(this.navigationManage,
				rhs.navigationManage).append(this.navigationTourDetail,
				rhs.navigationTourDetail).append(this.english, rhs.english)
				.append(this.chinese, rhs.chinese).append(this.navigationTour,
						rhs.navigationTour).append(
						this.navigationUpdateTourScheduler,
						rhs.navigationUpdateTourScheduler).isEquals();
	}
	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(1140954237, -1449277263).appendSuper(
				super.hashCode()).append(this.position).append(
				this.navigationUpdateTour).append(this.navigationInsertTour)
				.append(this.navigationCategory).append(
						this.navigationTourScheduler).append(
						this.navigationManage)
				.append(this.navigationTourDetail).append(this.english).append(
						this.chinese).append(this.navigationTour).append(
						this.navigationUpdateTourScheduler).toHashCode();
	}
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("chinese", this.chinese)
				.append("navigationInsertTour", this.navigationInsertTour)
				.append("navigationTourDetail", this.navigationTourDetail)
				.append("navigationUpdateTourScheduler",
						this.navigationUpdateTourScheduler)
				.append("navigationTourScheduler", this.navigationTourScheduler)
				.append("navigationManage", this.navigationManage).append(
						"navigationUpdateTour", this.navigationUpdateTour)
				.append("position", this.position).append("english",
						this.english).append("navigationTour",
						this.navigationTour).append("navigationCategory",
						this.navigationCategory).toString();
	}
}
